/*
 * @Author: your name
 * @Date: 2022-03-03 15:00:03
 * @LastEditTime: 2022-03-03 15:09:01
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \day05\13-this练习.js
 */
var o = {
    a: 10,
    b: {
        a: 12,
        fn: function(){
            console.log(this.a); //12
            console.log(this);  //b整个对象
        }
    }
}
//调用
o.b.fn(); //b对象拥有fn方法 所以 this指向b对象  ///看最近是谁调用
var o = {
    a: 10,
    b:  {
        fn: function(){
            console.log(this.a);  //undefined 

            console.log(this);   //b的整个对象
        }
    }
}
o.b.fn(); 